﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Routing;

namespace WhittleList.RouteContraints
{
    public class NoMatchConstraint : MatchConstraint
    {
        public NoMatchConstraint(params string[] matches)
        {
            Matches = matches;
        }

        public NoMatchConstraint(string match) : this(new string[]{match}){}

        public override bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            return !base.Match(httpContext, route, parameterName, values, routeDirection);
        }
    }
}
